package com.persondemo.videoappliction.module;
import android.content.Context;
import com.persondemo.videoappliction.MyApp;

import dagger.Module;
import dagger.Provides;

/**
 * Created by Administrator on 2018/3/19.
 */
//这里提供了AppComponent里的需要注入的对象。
@Module//提供依赖对象的实例
public class ApplicationModule {
    private Context mContext;
    public ApplicationModule(Context context) {
        this.mContext = context;
    }
    @Provides // 关键字，标明该方法提供依赖对象
    MyApp provideApplication() {
        //提供MyApp对象
        return (MyApp) mContext.getApplicationContext();
    }

    @Provides
    Context provideContext() {
        return mContext;
    }
}
